/**
 * Created with IntelliJ IDEA
 * Description:创建线程
 * User:恋恋
 * Date:2023-09-03
 * Time:9:44
 */

/**
 * 方法1继承Thread类
 */

class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("这里是继承Thread类创建一个线程类");
    }
}
public class Test{
    public static void main(String[] args) {
        MyThread t = new MyThread();
        //线程开始运行
        t.start();
    }
}
